package com.zsy.dao;

import com.zsy.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

public interface UserDao {
    @Select("select * from user where phone=#{phone}")
    User selectByPhone(String phone);

    @Insert("insert into user(phone,status) values(#{phone},#{status})")
    @Options(useGeneratedKeys = true,keyProperty ="id" ,keyColumn = "id")
    void save(User dbuser);

    @Select("select * from user where id=#{userId}")
    User findById(Long userId);
}
